{% extends 'layout_doc.html' %}
{% load comments %}

{% block page_title %}Blog{% endblock %}
{% block head_title %}Blog{% endblock %}

{% block feeds %}
  {{ block.super }}
  <link rel="alternate" type="application/rss+xml" href="/blog/feed/" />
{% endblock %}

{% block content %}
<div id="document-and-sidebar">

<div id="sidebar-container"><div id="sidebar-container-2"><ul id="sidebar">
  {% if can_post %}
    <li>
      <p>Staff Members</p>
      <ul class="links">  
          <li><a href="/blog/new-post/">New blog post...</a></li>
      </ul>
    </li>
  {% endif %}

  {% if latest %}
  <li>
    <p>
       {% if current_archive_date %}
          Posts from {{ current_archive_date|date:"F Y" }}
       {% else %}
          <a href="/blog/">Recent Posts</a>
          <a href="/blog/feed/"><img src="/media/img/feed-icon-14x14.png" width="14" height="14"
                                     alt="Subscribe to Posts"
                                     title="Subscribe to Posts" /></a>
       {% endif %}
    </p>
    <ul class="links">
      {% for post in latest %}
         <li><a href="{{ post.get_absolute_url }}">{{ post.title|escape }}</a></li>
      {% endfor %}
    </ul>
  </li>
  {% endif %}


  {% if recent_comments %}
  <li>
    <p>Latest Comments
       <a href="/blog/comment-feed/"><img src="/media/img/feed-icon-14x14.png" width="14" height="14"
                                          alt="Subscribe to Comments"
                                          title="Subscribe to Comments" /></a>
       </p>
    <ul class="links">
      {% for comment in recent_comments %}
         <li><a class="summary" href="{{ comment.get_content_object.get_absolute_url }}#c{{ comment.id }}">
           {{ comment.person_name|escape }}: <span>{{ comment.comment|escape }}</span>
         </a></li>
      {% endfor %}
    </ul>
  </li>
  {% endif %}

  {% if archive_dates %}
  <li>
    <p>Archives</p>
    <ul class="links">  
      {% for date in archive_dates %}    
         <li>
           {% ifequal date current_archive_date %} 
             {{ date|date:"F Y" }}
           {% else %}
             <a href="/blog/{{ date|date:"Y/m" }}/">{{ date|date:"F Y" }}</a>
           {% endifequal %}
         </li>
      {% endfor %}
    </ul>
  </li>
  {% endif %}

  {% include "doc/default_sidebar.html" %}
</ul></div></div>

{% block posts %}{% endblock %}

</div>
{% endblock %}
